home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 November
/
Chip_2004-11_cd1.bin
/
zkuste
/
dolby
/
download
/
dvdlab
/
DVDlabProRC2b.exe
/
{app}
/
Extras
/
Script
/
Flip Vertical.talk
< prev
next >
Wrap
Text File
|
2004-03-22
|
2KB
|
54 lines
/* Vertical Flip 1.0
by Oscar, 12 Dec 2003
this example simply flips a bitmap or object
To run this: DROP the Script from Assets to the Object in Menu.
Note: because of the bitmap merging, the text will become not-editable after you apply this
*/
// Get the current menu and selected object when you drag and drop script
// Note: if testing from Script editor make sure you have just one menu opened on desktop,
// in such case the MenuGetCurSel will return currently opened menu
menu = MenuGetCurSel()
// VTS menu 1..255, VMG menu 10001..10255
// show the current menu on top of all others
MenuActivate(menu)
object= ObjectGetCurSel(menu)
if (object==0) then
print "No object Selected"
end
endif
//get the image buffer from object and store it in buffer 1
ImgGrabObject(1,menu,object) // imgNum = temporary image buffer 1,2 or 3
imgW = ImgGetWidth(1)
imgH = ImgGetHeight(1)
// create the target, same size
ImgCreate(2,imgW,imgH)
// trace is same as print, but it will appear only in the Output window in editor
trace "Vertical Flipping W =",imgW, " H=",imgH
// this is interpreter so it is slow!
// show some progress or else people will see nothing happening for while
ProgressBar(0,imgH,"Flipping!")
// all in lab-talk starts from 1, also the image, the first line is line 1
for y=1 to imgH
ProgressSetPos(y)
// copy row from 1 to 2
ImgCopyRow(1,y,2,imgH-y+1)
next x
// now put the img buffer 2 into the object!
ImgSetToObject(2,menu,object)